package com.danny.demo.proxy.jdk;

import java.lang.reflect.Proxy;

/**
 * @ClassName: Client
 * @Description: TODO
 * @Author: zhangdong
 * @Date: Created in 15:43 2019/6/26
 * @Version:
 */
public class Client {
    public static void main(String[] args) {

        //真实对象
        Subject subject = new RealSubject();

        MyInvocationHandler myInvocationHandler = new MyInvocationHandler(subject);

        Subject proxyClass = (Subject)Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(),new Class[] {Subject.class},myInvocationHandler);

        proxyClass.read();
    }
}
